package site;

import java.util.Calendar;
import java.util.Collection;
import java.util.Vector;

import javax.persistence.*;

@Entity
public class Membre extends Utilisateur {

	private static final long serialVersionUID = 1L;
	
	@Temporal(TemporalType.DATE)
	@Column(name="detaAdhesion")
	private Calendar dateAdhesion;
	
	@Column(name="nationalite")
	private String nationalite ;
	
	@ManyToOne
	@JoinColumn(name="ecoleIngenieur", referencedColumnName="nomEcole")
	private EcoleIng ecole;
	
	@OneToMany(targetEntity=Article.class, cascade = {CascadeType.ALL}, mappedBy ="author")
	private Collection<Article> articlesEcrits
	=new Vector<Article>();

	@OneToMany(targetEntity=Activite.class, cascade = {CascadeType.ALL}, mappedBy ="createurActivite")
	private Collection<Activite> activiteOrganisee
	=new Vector<Activite>();

	@OneToMany(targetEntity=Reunion.class, cascade = {CascadeType.ALL}, mappedBy ="createurReunion")
	private Collection<Reunion> reunionOrganisee
	=new Vector<Reunion>();
	
	@Column(name="villeActuelle")
	private String villeActuelle ;


	public Membre() {
		
	}
	
	public Calendar getDateAdhesion() {
		return dateAdhesion;
	}

	public void setDateAdhesion(Calendar dateAdhesion) {
		this.dateAdhesion = dateAdhesion;
	}

	public String getVilleActuelle() {
		return villeActuelle;
	}

	public void setVilleActuelle(String villeActuelle) {
		this.villeActuelle = villeActuelle;
	}

	public String getNationalite() {
		return nationalite;
	}

	public void setNationalite(String nationalite) {
		this.nationalite = nationalite;
	}

	public EcoleIng getEcole() {
		return ecole;
	}

	public void setEcole(EcoleIng ecole) {
		this.ecole = ecole;
	}

	public Collection<Article> getArticlesEcrits() {
		return articlesEcrits;
	}

	public void setArticlesEcrits(Collection<Article> articlesEcrits) {
		this.articlesEcrits = articlesEcrits;
	}

	public Collection<Reunion> getReunionOrganisee() {
		return reunionOrganisee;
	}

	public void setReunionOrganisee(Collection<Reunion> reunionOrganisee) {
		this.reunionOrganisee = reunionOrganisee;
	}

	public Collection<Activite> getActiviteOrganisee() {
		return activiteOrganisee;
	}

	public void setActiviteOrganisee(Collection<Activite> activiteOrganisee) {
		this.activiteOrganisee = activiteOrganisee;
	}

}
